package cn.yunhe.controller;

import cn.yunhe.services.IHotServices;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2018/6/5.
 */
@RestController
@RequestMapping("/hotPrac")
public class HotController {
    @Resource
    IHotServices hotServices;

    @RequestMapping("/updateHot")
    public void updateHot(int pro_id){
        Map map=new HashMap();
        map.put("pro_id",pro_id);
        int true_hot=hotServices.getByHot(pro_id);
        map.put("true_hot",true_hot+1);
        hotServices.updateHot(map);
    }

    public IHotServices getHotServices() {
        return hotServices;
    }

    public void setHotServices(IHotServices hotServices) {
        this.hotServices = hotServices;
    }
}
